'use strict';

let baseService =require('./baseService.js');

class roleService extends baseService {
   async list(modalJson) {
        const {service,model} = this.ctx;

        let listResult=await model.Role.find(modalJson);

        return listResult
    }
    async doAdd(bodyData) {
        const {service,model} = this.ctx;
        let res=new model.Role(bodyData)
        let addResult=await res.save();

        return addResult
    }
    async doEdit(editId) {
        const {service,model} = this.ctx;
        let editResult=await model.Role.find({"_id":editId});

        return editResult
    }
    async findById(findId) {
        const {service,model} = this.ctx;
        let findResult=await model.Role.find({"_id":findId});

        return findResult
    }
}

module.exports =roleService;

